package com.jiyun.feign;

import com.github.pagehelper.PageInfo;
import com.jiyun.model.day08.Course;
import com.jiyun.model.day08.Remark;
import com.jiyun.vo.Result;
import com.jiyun.vo.day08.CourseCto;
import com.jiyun.vo.day08.CourseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author yangYingJie
 * @Date 2023/8/23 20：31
 **/
@FeignClient("day05-course")
public interface FeignCourse {
    @RequestMapping("/course/findAll2")
    public List<Course> findAll2();

    @RequestMapping("/traineeCourse/findNum/{id}")
    public String findNum(@PathVariable("id") Integer id);

    @RequestMapping("/course/findDesc")
    public List<Course> findDesc();

    @RequestMapping("/course/findCAll")
    public PageInfo<CourseVo> findCAll(@RequestBody CourseCto cto);

    @RequestMapping("/course/findById/{id}")
    public CourseVo findById(@PathVariable("id") String id);

    /**
     * 当前登录人的Id  查询是否做过课程
     * 如果做过题就查询到所有课程
     *
     * @param id
     * @return
     */
    @RequestMapping("/course/findByIdCataloges/{id}")
    public List<CourseVo> findByIdCataloges(@PathVariable("id") Integer id);

    @RequestMapping("/remark/findById/{id}")
    public List<Remark> findById(@PathVariable("id")Integer id);

    @RequestMapping("/remark/addRemark")
    public void addRemark(@RequestBody Remark remark);

    @RequestMapping("/remark/deleteRemark/{id}")
    public void deleteRemark(@PathVariable("id")String id);
}
